#!/bin/bash


# 使用
# 
# sh databaseDump.sh ./2020-12-22_wordpress_wl.sql
# 
# 
# 使用 end 



pwdPath=${PWD}/variable-group
# echo ${pwdPath}
# echo ""

# =============== 加载其他文件的内容 ==================

# variableMysql="${PWD}/variable-mysql.sh"
# echo ${variableMysql}
# echo ""

# variableFile="${PWD}/variable-file.sh"
# echo ${variableFile}
# echo ""

# params="${pwdPath}/params.sh"
# echo ${params}

# source ${params}
# source ${variableFile}
# source ${variableMysql}


sourceFile="${pwdPath}/source-file.sh"
echo ${sourceFile}
source ${sourceFile}

# =============== 加载其他文件的内容 ==end=============

echo ${HOSTNAME}
# echo ""

echo ${PORT}
# echo ""

echo ${USERNAME}
# echo ""

echo ${PASSWORD}
# echo ""

echo ${DBNAME}
# echo ""

echo ${PathFile}
# echo ""



echo ${muidUs}
echo ${mids}
echo "${dates}-${fileName}"

echo ${dates}

pathFileSaveSql=${muidUs}

echo ${pathFileSaveSql}
echo ""

if [ -z "$pathFileSaveSql" ]; then
	echo "pathFileSaveSql is empty"
	exit 10
fi

if [ -z "$muidUs" ]; then
	echo "muid is empty"
	exit 10
fi


# --------- 导出数据库 --------- 
${MYSQLBINSHDUMP} -h${HOSTNAME}  -P${PORT} -u${USERNAME} -p${PASSWORD} --default-character-set utf8  ${DBNAME} > ${pathFileSaveSql}
# --------- 导出数据库 --------- 




